class THEWTFProj extends BomberWProjWTF;

simulated function Timer()
{
	if ( EffectIsRelevant(Self.Location,false) )
	{
		Spawn(class'BomberWProjWTFExplosion',self,,Self.Location,rotator(Self.Location));
		Explode(Self.Location,Self.Location);
	}
}

simulated function Explode(vector HitLocation, vector HitNormal)
{
    local Controller C;
    local PlayerController  LocalPlayer;

    bHasExploded = True;

    BlowUp(HitLocation);
	
    // Shake nearby players screens
    LocalPlayer = Level.GetLocalPlayerController();
    if ( (LocalPlayer != None) && (VSize(Location - LocalPlayer.ViewTarget.Location) < ShakeRadius) )
        LocalPlayer.ShakeView(RotMag, RotRate, RotTime, OffsetMag, OffsetRate, OffsetTime);

    for ( C=Level.ControllerList; C!=None; C=C.NextController )
        if ( (PlayerController(C) != None) && (C != LocalPlayer)
            && (VSize(Location - PlayerController(C).ViewTarget.Location) < ShakeRadius) )
            C.ShakeView(RotMag, RotRate, RotTime, OffsetMag, OffsetRate, OffsetTime);
}

function TakeDamage( int Damage, Pawn InstigatedBy, Vector Hitlocation, Vector Momentum, class<DamageType> damageType, optional int HitIndex)
{
	//I am so awesome I don't get blown up by taking damage
}

simulated singular function HitWall(vector HitNormal, actor Wall)
{
	Landed(HitNormal);
}

simulated function Landed( vector HitNormal )
{
	Velocity = vect(0,0,0);
	SetPhysics(PHYS_Falling);
	SetTimer(0.25,true);
	AmbientSound=none;
}

simulated function ProcessTouch(Actor Other, Vector HitLocation)
{
	if ( Other == none || Other == Instigator || Other.Base == Instigator  )
		return;
		
	if (bHasExploded)
		return;

    // Use the instigator's location if it exists. This fixes issues with
    // the original location of the projectile being really far away from
    // the real Origloc due to it taking a couple of milliseconds to
    // replicate the location to the client and the first replicated location has
    // already moved quite a bit.
    if( Instigator != none )
    {
        OrigLoc = Instigator.Location;
    }

	Landed(HitLocation);
}

simulated function HurtRadius( float DamageAmount, float DamageRadius, class<DamageType> DamageType, float Momentum, vector HitLocation )
{
}

defaultproperties
{
     ImpactDamage=0
     Speed=0.000000
     MaxSpeed=0.000000
     StaticMesh=None
     AmbientSound=None
     LifeSpan=3.000000
}
